var WanFaWindow = Window.extend({
    _ccsFileName: res.WanFaWindow_json,
    _notCloseBlock: false,
    _btnsList: [
        ['_clickSub_Pdk', 'btn_paodekuai'],
        ['_clickSub_Mj', 'btn_majiang'],
        ['_clickSub_Hz', 'btn_zipai'],
        ['_clickSub_ddz', 'btn_doudizhu'],
    ],
    initWindow: function (clubId, currentWnafaIdex) {
        this._clubId = clubId;
        this._currentWnafaIdex = currentWnafaIdex;
    },
    _initClickListeners: function () {
        for (var i = 0; i < this._btnsList.length; i++) {
            var _name = this._btnsList[i][1];
            var btn = this._nodeList[_name];
            if (btn) {
                btn.setTag(i);
                this._clickListeners[_name] = '_clickButton';
            }
        }
    },
    /**
     * 点击按钮
     * @private
     */
    _clickButton: function (btn) {
        var tag = btn.getTag();
        var param = this._btnsList[tag];
        if (!param) return;
        //点击
        var _click = param[0];
        var isSetWanfa = (this._currentWnafaIdex != 5);
        var isDaiKai = (this._currentWnafaIdex == 5);
        if (_click && _click.length > 0) {
            var obj = {
                click: _click,
                clubId: this._clubId,
                isSetWanfa: isSetWanfa,
                currentWnafaIdex: this._currentWnafaIdex,
                isDaiKai: isDaiKai
            };
            window.eventManager.dispatchEvent(EventKey.HallBoardRoomBtnEvent, obj);
        }
        this.removeFromParent(true);
    }
});